package ddemo.service;

import ddemo.dao.ParkinglotMapper;
import ddemo.dao.ParkingspotMapper;
import ddemo.factory.MapperProxyFactory;
import ddemo.pojo.Parkinglot;
import ddemo.pojo.Parkingspot;

import java.util.List;

public class ParkingspotService {
    static ParkingspotMapper parkingspotMapper= MapperProxyFactory.getMapper(ParkingspotMapper.class);
    public static List<Parkingspot> searchParkingspots(Integer lotid){
        return parkingspotMapper.searchparkingspot(lotid);
    }

    public static List<Parkingspot> getParkingspots() {
        return parkingspotMapper.getParkingspot();
    }

    public static int deleteInterface(int parseInt) {
        return parkingspotMapper.deleteParkingspot(parseInt);
    }

    public static int addParkingspot(Integer lotid) {
        String usestatus="可用";
        Integer userid=0;
        return parkingspotMapper.addParkingspot(lotid,usestatus,userid);
    }
}
